import 'package:flutter/material.dart';
import 'package:flutter_html/flutter_html.dart';
import 'package:flutterproject/page/main/data/notice_bean.dart';
import 'package:flutterproject/util/extension/extension_util.dart';
import 'package:flutterproject/util/margin_padding_util.dart';
import 'package:flutterproject/widget/app_bar_common.dart';
import 'package:flutterproject/widget/text/text_common.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';

class AnnounceDetail extends StatelessWidget {
  final NoticeBean bean;

  const AnnounceDetail({super.key, required this.bean});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: Get.width,
      height: Get.height,
      color: Color(0xFFF6F6F6),
      child: Column(
        children: [
          AppBarCommon(
            title: '',
          ),
          59.heightBox,
          Expanded(
            child: Padding(
              padding: MarginPaddingUtil.symmetric(horizontal: 42),
              child: ListView(
                shrinkWrap: true,
                children:
                  [
                    TextCommon(
                      bean.title ?? "",
                      size: 36.sp,
                      fontWeight: FontWeight.w500,
                      color: Colors.black,
                      lineHeight: 52.sp,
                    ),
                    5.heightBox,
                    TextCommon(
                      DateFormat("yyyy-MM-dd HH:mm:ss").format(
                          DateTime.fromMillisecondsSinceEpoch(
                              bean.publishTime ?? 0)),
                      color: Color(0xFFFF6C727D),
                      size: 24.sp,
                      lineHeight: 35.sp,
                    ),
                    44.heightBox,
                    Html(
                      data: bean.content ?? "",
                    )
                  ]
                ,
              ),
            ),
          ),
        ],
      ),
    );
  }
}
